package com.example.Laboratory.Mapper;


import com.example.Laboratory.Entity.Open_subject;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface Open_subjectMapper {
    //增加开放课题
    @Insert("INSERT INTO open_subject(open_subject_title,open_subject_publisher,open_subject_time,open_subject_text)VALUES(#{open_subject_title},#{open_subject_publisher},#{open_subject_time},#{open_subject_text})")
    int addOpen_subject (Open_subject t);

    //根据id删除开放课题
    @Delete("DELETE FROM open_subject WHERE open_subject_id=#{open_subject_id}")
    int deleteOpen_subject (int open_subject_id);
    //

    //修改开放课题
    @Update("UPDATE open_subject SET open_subject_title=#{open_subject_title},open_subject_publisher=#{open_subject_publisher},open_subject_time=#{open_subject_time},open_subject_text=#{open_subject_text} WHERE open_subject_id=#{open_subject_id}")
    int reviseOpen_subject (Open_subject t);

    //查找开放课题
    @Select("SELECT * FROM open_subject ")
    List<Open_subject> researchOpen_subject ( );


}

